From: Brion Vibber Date: Sat, 14 Jan 2006 04:34:06 +0000 (+0000) Subject: Reverted Domas's last checkin. Broken! Please test more thoroughly before checkin. X-Git-Tag: 1.6.0~558 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=14d561739d5d9ab123fe9eeb3e4f3cc8e82fb9de;p=lhc%2Fweb%2Fwiklou.git Reverted Domas's last checkin. Broken! Please test more thoroughly before checkin. Tabs had the wrong page info (redirect source instead of target) --- diff --git a/includes/Wiki.php b/includes/Wiki.php index 8c320040d0..996a5cf832 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -195,7 +195,6 @@ class MediaWiki { * @return mixed an Article, or a string to redirect to another URL */ function initializeArticle( $title, $request ) { - global $wgTitle; wfProfileIn( 'MediaWiki::initializeArticle' ); $action = $this->getVal('Action'); @@ -203,33 +202,21 @@ class MediaWiki { // Namespace might change when using redirects if( $action == 'view' && !$request->getVal( 'oldid' ) && $request->getVal( 'redirect' ) != 'no' ) { - $dbr=&wfGetDB(DB_SLAVE); - $article->loadPageData($article->pageDataFromTitle($dbr,$title)); - /* Follow redirects only for... redirects */ - if ($article->mIsRedirect) { - $target = $article->followRedirect(); - if( is_string( $target ) ) { - global $wgDisableHardRedirects; - if( !$wgDisableHardRedirects ) { - // we'll need to redirect - return $target; - } + $target = $article->followRedirect(); + if( is_string( $target ) ) { + global $wgDisableHardRedirects; + if( !$wgDisableHardRedirects ) { + // we'll need to redirect + return $target; } - if( is_object( $target ) ) { - // evil globals hack! - /* Rewrite environment to redirected article */ - $rarticle =& new Article($target); - $rarticle->loadPageData($rarticle->pageDataFromTitle($dbr,$target)); - if ($rarticle->mTitle->mArticleID) { - $article =& $rarticle; - $wgTitle =& $target; - $article->setRedirectedFrom( $title ); - } else { - $wgTitle =& $title; - } - } - } else { - $wgTitle =& $article->mTitle; + } + if( is_object( $target ) ) { + // evil globals hack! + global $wgTitle; + $wgTitle = $target; + + $article = $this->articleFromTitle( $target ); + $article->setRedirectedFrom( $title ); } } wfProfileOut( 'MediaWiki::initializeArticle' ); @@ -376,4 +363,4 @@ class MediaWiki { }; /* End of class MediaWiki */ -?> +?> \ No newline at end of file